<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="js/mui.min.js"></script>
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/sub.css" />
		<link rel="stylesheet" type="text/css" href="css/home.css" />
		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>
	</head>
	<body class="bg-f8">
	 <header class="mui-bar mui-bar-nav login">
	       <a class="mui-action-back mui-pull-left icon-left"></a>
	       <a href="register.html" class="mui-pull-right mt30 reg-btn">注册</a>
	  </header>
  	<div class="login-cover">
	</div>
	<div class="login-bg">
		<img src="img/static/login-bg.png"/>
	</div> 
	<div class="mui-content ">
		<div class="login-body">
			<div class="tc">
			<img src="img/static/logo_wh.png" class="login-body-logo"/>
			</div>
			<div class="login-body-header">
				<img src="img/static/cirheader.png"/>
			</div>
			<div class="login-form">
				<ul class="mui-clearfix mt12">
					<form action="" method="post" id="loginform">
						<li class="login-unl"><i class="icon-phone"></i><input type="text" name="phonenum" id="phonenum" value="" placeholder="请输入账号/手机号"/></li>
						<li class="login-unl"><i class="icon-myrepassword"></i><input type="password" name="password" id="password" value="" placeholder="请输入密码"/><i class="icon-seepassowrd"></i></li>
						<li><button class="login-btn" id="login-btn">登录</button></li>
						<li class="mui-clearfix"><a href="" class="mui-pull-right forget-href">忘了密码？</a></li>
						<!--<li><span class="">OR</span></li>-->
					</form>
				</ul>
			</div>
		</div>
	</div>
	<script src="js/mod.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/cookie.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
			$("#login-btn").click(function(){
				var loginData = setJson($("#loginform"));
				$.ajax({
				type:"post",
				url:"http://www.xhwed.com/xhwe.php/LoginRegistr/UserLand",
				datatype:"json",
				data:loginData,
				async:true,
				success:function(data){
					data = JSON.parse(data);
					if(data.msg=="success")
					{
						setCookie("user",data.result.user,"1h");
						//setCookie("username",data.result.username,"1h");
						mui.alert("登录成功！确认跳转到首页");
						setTimeout(function(){
							window.location.href="index.html";
						})
					}else{
						mui.alert(data.result);
					}
				}
			});
			return false;
			})
	       /*设置表单数据转json*/
			function setJson($jq) {
				var data = {};
				$jq.serializeArray().map(function(x) {
					data[x.name] = x.value;
				});
				return data;
			}
	</script>
	</body>
</html>